package com.maimao.user.mapper.sys;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.maimao.model.user.sys.Department;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author MaoLin Wang
 * @date 2020/11/30 9:38 下午
 */
public interface DepartmentMapper extends BaseMapper<Department> {

    /**
     * 树形数据
     * @param parentId
     * @return
     */
   List<Department> selectTree(@Param("parentId") Integer parentId);

    List<Department> selectByParentId(@Param("parentId") Integer parentId);

    Department selectByIdCus(@Param("id") Integer id);

    /**
     * 用于判断是否存在
     * @param id
     * @return
     */
    Department selectByIdSimple(@Param("id") Integer id);

//    @Override
//    int insert(Department addData);

    void updateCus(Department department);
}
